<?php
declare (strict_types=1);

namespace app\controller\home;

use app\common\controller\BaseController;
use app\model\home\Test as testModel;
use think\App;
use \Throwable;

class Test extends BaseController
{
    protected $model;

    public function __construct(App $app, testModel $model)
    {
        parent::__construct($app);
        $this->model = $model;
    }

    /**
     * 新建
     * POST    blog
     * @return array
     */
    public function create(): array
    {
        try {
            return $this->model->add($this->params);
        } catch (Throwable $ex) {
            return $this->returnException($ex);
        }
    }
}
